<html>

<head>
    <meta charset="UTF-8">
    <title>应用模型信息内部服务列表</title>
    <link id="easyuiTheme"  href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
    <script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
    <script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
    <script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
    <script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
    <script src="../../ffres/dict/all.js" type="text/javascript"></script>
    <a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<script type="text/javascript">
    var appId = $.getUrlParam('appId');

    function onDblClickRow(index,row) {
        window.parent.onChooseInnerService(row);
        window.parent.JLEUtil.closewin();
    }

    function selectReturn() {
        var row = $('#dg').datagrid('getSelected');
        if (row) {
            onDblClickRow(-1, row);
        } else {
            $.messager.alert('提示', '请选择一条记录！', 'info');
        }
    }

    function closeForm() {
        window.parent.JLEUtil.closewin();
    }


    function reloadList(packageCode, appModelCatalog) {
        $('#dg').datagrid({
            url: `../../api/app/model/infos`,
            queryParams:{
                // 'packageId':packageId,
                'appId': appId,
                'appModelCatalog':appModelCatalog, 
                'tableModelCode': packageCode
            }
        });
    };
    $(function () {
        var appModelCatalogs = ["I00", "I01", "I11", "I91"];
        $('#nav').tree({
			url:'../../api/app/model/tree/nav/' + $.getUrlParam('appId') + '/catalog',
			queryParams : {
				appModelCatalogs : appModelCatalogs.join(",")
			},
			onClick: function(node){
				var parent = $('#nav').tree('getParent', node.target);
				if(node.attributes.pType=='page'){
					reloadList(node.attributes.package_code, node.attributes.app_model_catalog)
				} else if(node.attributes.pType=='dir'){
					
				}
			}
		})
    });
</script>
</head>

<body class="easyui-layout">
    <div data-options="region:'west',title:'导航栏'" style="width:283px;padding:1px;">
    <ul id="nav" class="easyui-tree" 
                data-options="animate:true,
                    lines:true,method:'post',
                    animate:true" id="menu_app1">
    </ul>
    </div>
    <div data-options="region:'center',split:false">
        <table id="dg" class="easyui-datagrid" title="" style="width:100%;height:90%"
            data-options="singleSelect:true,collapsible:true,method:'post',onDblClickRow:onDblClickRow" title="Load Data"
            rownumbers="true" pagination="true" pageSize="20">
            <thead>
                <tr>
                    <th data-options="field:'appModelId',resizable:true">业务模型标识</th>
                    <th data-options="field:'appModelCode',resizable:true">业务模型代码</th>
                    <th data-options="field:'appModelName',resizable:true">业务模型名称</th>
                    <th data-options="field:'appModelCatalog',resizable:true" formatter="formatter_APP_MODEL_CATALOG">
                        业务模型分类</th>
                    <th data-options="field:'appModelType',resizable:true" formatter="formatter_APP_MODEL_TYPE">业务模型类型
                    </th>
                    <th data-options="field:'packageId',resizable:true">目录包标识</th>
                    <th data-options="field:'tableModelId',resizable:true">表模型ID</th>
                    <th data-options="field:'tableModelCode',resizable:true">表模型代码</th>
                    <th data-options="field:'tableModelName',resizable:true">表模型名称</th>
                    <th data-options="field:'createUser',resizable:true">创建人</th>
                    <th data-options="field:'createTime',resizable:true">创建时间</th>
                    <th data-options="field:'lastUpdateUser',resizable:true">最后修改人</th>
                    <th data-options="field:'lastUpdateTime',resizable:true">最后更新时间</th>
                </tr>
            </thead>
        </table>
        <div style="text-align: center; padding: 15px;height: 10%;">
            <a href="javascript:void(0)" class="easyui-linkbutton"
               onclick="selectReturn()">&nbsp;选择返回&nbsp;</a>
            <a href="javascript:void(0)" class="easyui-linkbutton"
               onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
        </div>
    </div>
</body>

</html>